﻿Type.registerNamespace("Sitefinity.Contrib.SocialWidgets.YouTube");

Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner = function (element) {
    Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner.initializeBase(this, [element]);
}


Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner.prototype = {
    initialize: function () {
        Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner.callBaseMethod(this, 'initialize');

    },
    dispose: function () {
        Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner.callBaseMethod(this, 'dispose');
    },
    refreshUI: function () {
        var data = this._propertyEditor.get_control();
        jQuery("#UserName").val(data.UserName);
        jQuery("#MaximumVideos").val(data.MaximumVideos);
        jQuery("#RotationTimerSeconds").val(data.RotationTimerSeconds);
        jQuery("#Width").val(data.Width);
        jQuery("#Height").val(data.Height);
    },
    applyChanges: function () {
        var controlData = this._propertyEditor.get_control();

        controlData.UserName = jQuery("#UserName").val();
        controlData.MaximumVideos = jQuery("#MaximumVideos").val();
        controlData.RotationTimerSeconds = jQuery("#RotationTimerSeconds").val();
        controlData.Width = jQuery("#Width").val();
        controlData.Height = jQuery("#Height").val();
    }
}

Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner.registerClass('Sitefinity.Contrib.SocialWidgets.YouTube.YouTubeVideoRotatorWidgetDesigner', Telerik.Sitefinity.Web.UI.ControlDesign.ControlDesignerBase);
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();